package cn.iphone.NPlayer.web.controller;

import cn.iphone.NPlayer.CourseDoc;
import cn.iphone.NPlayer.result.JSONResult;
import cn.iphone.NPlayer.service.ICourseEsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/courseEs")
public class CourseEsController {
    @Autowired
    private ICourseEsService courseEsService;


    @PostMapping("/onLineCourse")
    public JSONResult saveCourseEs(@RequestBody CourseDoc courseDoc){
        courseEsService.onLineCourse(courseDoc);
        return JSONResult.success();
    }
    @PostMapping(value = "/offLineCourse/{courseId}")
    public JSONResult offLineCourse(@PathVariable("courseId") Long courseId){
        courseEsService.offLineCourse(courseId);
        return JSONResult.success();
    }
}
